<?php
/**
 * Created by PhpStorm.
 * User: reshared
 * Date: 2017/9/29
 * Time: 下午7:28
 */

namespace Index\Repository\Tra;


trait InstanceTrait
{
    /**
     * 对象实例
     * @var
     */
    protected static $instance;

    /**
     * 单一模式实现仓库对象
     * @return mixed
     */
    public static function instance()
    {
        if (!static::$instance) {
            static::$instance = new self();
        }

        return static::$instance;
    }
}